"""
列表推导式拓展
"""
import random

# list1 = ['a','b','c','d']
# list2 = [1,2,3,4]
#
# list3 = [i+str(j) for i in list1 for j in list2]
#
# print(list3)
suits = ['♠', '♥', '♦', '♣']  # 黑桃、红心、方块、梅花
ranks = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']

# 准备扑克
poker = [suit + rank for suit in suits for rank in ranks] + ['大王','小王']
print(poker)

# 洗牌
random.shuffle(poker)
print('洗牌后:')
print(poker)

# list1 = [1,2,3,4,5,68,78,15,23,44,55]
#
# random.shuffle(list1) # 用于就地(不会返回新的列表)随机打乱可变序列（如列表）的顺序
#
# print(list1)

# 洗牌
# new_poker = [] # 用于存放洗好的牌
# for i in range(len(poker)):
#     index = random.randint(1, len(poker)) # 生成的随机数不能重复
#     print(index)


